package com.example.demo;

import org.noear.solon.Solon;
import org.noear.solon.annotation.SolonMain;
import org.noear.solon.core.event.AppBeanLoadEndEvent;
import org.noear.solon.core.event.AppInitEndEvent;
import org.noear.solon.core.event.AppLoadEndEvent;
import org.noear.solon.core.event.AppPluginLoadEndEvent;

/**
 * Solon 工程启动入库
 *
 * @author raos
 * @date 2024/3/6
 **/
@SolonMain
public class App {

    public static void main(String[] args) {
        // 初始启动代码
//        Solon.start(App.class, args);
        // solon生命周期之事件应用-应用初始化完成事件
        Solon.start(App.class, args, app -> {
            app.onEvent(AppInitEndEvent.class, e -> {
                System.out.println("应用初始化完成...");
            });
            app.onEvent(AppPluginLoadEndEvent.class, e -> {
                System.out.println("应用插件加载完成...");
            });
            app.onEvent(AppBeanLoadEndEvent.class, e -> {
                System.out.println("应用bean加载完成...");
            });
            app.onEvent(AppLoadEndEvent.class, e -> {
                System.out.println("应用加载启动完成...");
            });
        });
    }

}